//
//  ChooseGameModeScreen.m
//  iSudoku
//
//  Created by acumen on 5/25/13.
//  Copyright 2013 Tri Vo. All rights reserved.
//

#import "ChooseGameModeScreen.h"
#import "GameUtils.h"


@implementation ChooseGameModeScreen

+ (id)scene {
    CCScene *scene = [CCScene node];
    ChooseGameModeScreen *chooseGameScene = [ChooseGameModeScreen node];
    [scene addChild:chooseGameScene];
    return scene;
}

- (id)init {
    self = [super init];
    if (self) {
        // Do something here
    }
    return self;
}

- (void)dealloc {
    [super dealloc];
}

#pragma mark - Screen methods

- (void)onEnter {
    
}

#pragma mark - Screen event

- (void) btnClicked:(id)sender {
    CCControlButton *btn = (CCControlButton *)sender;
    int tag = btn.tag;
    switch (tag) {
        case MODE_NORMAL:
        {
            [[GameUtils getInstance] setGameMode:GAME_MODE_NORMAL];
        }
            break;
        case MODE_COUNTDOWN:
        {
            [[GameUtils getInstance] setGameMode:GAME_MODE_COUNTDOWN];
        }
            break;
        default:
            [[GameUtils getInstance] doBack];
            break;
    }
    CCScene *scene = [CCBReader sceneWithNodeGraphFromFile:@"LevelScreen.ccbi"];
    [[CCDirector sharedDirector] pushScene:[CCTransitionSlideInR transitionWithDuration:0.5f scene:scene]];
}

@end
